package dataSource;


import com.alibaba.druid.pool.DruidDataSourceFactory;
import org.apache.ibatis.datasource.DataSourceFactory;

import javax.sql.DataSource;
import java.util.Properties;

public class MyDruidDataSourceFactory implements DataSourceFactory {


    private Properties props;
    public void setProperties(Properties props) {
        this.props = props;
    }

    public DataSource getDataSource() {

        try {
            return DruidDataSourceFactory.createDataSource(props);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
